﻿//////////////////////////////////////////////////////////////////////////////////// Licensed under the MIT License//// Copyright (c) 2008 Chris Colinsky// All Rights Reserved//// version	0.4// http://code.google.com/p/sugarcookie/// http://code.google.com/p/sugarcookie/wiki/License///////////////////////////////////////////////////////////////////////////////////** * The DecimalToHex transforms decimal based number to Hexidecimal strings */class sugarcookie.number.DecimalToHex {	/**	 * DecToHex, basically does what it says it does	 *	 * @param x number to be transformed into hex	 */	public static function DecToHex(x:Number):String {		var s:String = '';		var x_:Number = !isNaN(Number(x)) ? Number(x) : 0;		while( Boolean( x_ ) ) { 			s = '0123456789ABCDEF'.charAt( x_ & 0xf ) + s; x_ >>>= 4; 		}		while ( s.length & 0x7 ) { 			s = '0' + s; 		} 		return s;	}}